package Proxy;

import java.util.HashMap;
import java.util.Map;

public class DataProxy implements DataGetter {
    private Map<String, String> buffer = new HashMap<>();
    private DataStore dStore = new DataStore();
    @Override
    public String getData(String name) {
        if(!buffer.containsKey(name)) {
            buffer.put(name, dStore.getData(name));
        }
        return buffer.get(name);
    }
}
